package com.pms.framework;

import java.util.Hashtable;

public class ActionMap {
	
	String actionClass; // gives the action class name which will ne instantiated & call the method execute. This action contains the main action commands which has to be executed based on the user requerst call Business logic, do a booking for eg.
	String validatorClass; // gives the validator class name which will ne instantiated & call the method validate. Validator gives the basic validation of the form submited and other msgs
	Hashtable forwardList; // gives the list of tokens with page where to go further like sucess , failure
	boolean forwardOnly ;  // doesn't need to call the action class directly redirect it to token
	
	public boolean isForwardOnly() {
		return forwardOnly;
	}

	public void setForwardOnly(boolean forwardOnly) {
		this.forwardOnly = forwardOnly;
	}

	public Action getActionClass() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		return (Action) Class.forName(actionClass).newInstance();
	}
	
	public void setActionClass(String actionClass) {
		this.actionClass = actionClass;
	}
	
	public Hashtable getForwardList() {
		return forwardList;
	}
	
	public void setForwardList(Hashtable forwardList) {
		this.forwardList = forwardList;
	}
	
	public Validator getValidatorClass() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		return (Validator) Class.forName(validatorClass).newInstance();
	}
	
	public void setValidatorClass(String validatorClass) {
		this.validatorClass = validatorClass;
	}
	
	
	
}
